package com.mdd.common.enums;

/**
 * 相册枚举
 */
public enum CaseStatusEnum {

    WAITING_FOR_REVIEW(0, "待审核"),
    REVIEW_PASS(1, "待签约"),
    REVIEW_REJECT(2, "审核驳回"),
    WAITING_TAKE_ORDER(3, "待接单"),
    WAITING_FOR_PAY(4, "律师未支付"),
    TOKEN_ORDER(5, "律师已接单"),
    PAID(6, "已支付"),
    FINISH(7, "已完成");

    /**
     * 构造方法
     */
    private final int code;
    private final String msg;
    CaseStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    /**
     * 获取状态码
     *
     * @author fzr
     * @return Long
     */
    public int getCode() {
        return this.code;
    }

    /**
     * 获取提示
     *
     * @author fzr
     * @return String
     */
    public String getMsg() {
        return this.msg;
    }

    public static String getMsgByCode(Integer code){
        for(CaseStatusEnum enumItem: CaseStatusEnum.values()) {
            if (enumItem.getCode() == code) {
                return enumItem.getMsg();
            }
        }
        return null;
    }

}
